wayland: Refactor selection ownership
authorCarlos Garnacho <carlosg@gnome.org>
Mon, 30 Nov 2015 17:35:10 +0000 (18:35 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Mon, 30 Nov 2015 19:37:25 +0000 (20:37 +0100)
commit4f9d0c06ef69b76174fbfe9051f6ab348eed295c
tree16f3487033c0cb4bfc0993730afc0fe9dc9e2b84
parent1a8f3e2462829f8a186590a6ad6b7642309baa5b
wayland: Refactor selection ownership

Dissociate ownership from our maintenance of wl_data_source objects.
The only place where ownership must be updated together is
data_source.cancelled, for the other places GDK should take care of
setting up the right ownership, even if at a different order than
we'd expect here.

This fixes GTK+ apps on wayland being locally confused about the
current selection ownership. Because gtk_selection_add_targets()
results in a wl_data_source being created, and ownership being
updated right away, early callers of this will change the ownership
even if the widget it's being called on didn't explicitly request
the selection ownership yet.

https://bugzilla.gnome.org/show_bug.cgi?id=758660
gdk/wayland/gdkselection-wayland.c